/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package give.replay.gui;

import give.replay.GameEvent;
import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractListModel;

/**
 *
 * @author koller
 */
public class EventListModel extends AbstractListModel {
    private List<GameEvent> events;
    private List<Integer> eventIndices;

    public EventListModel() {
        eventIndices = new ArrayList<Integer>();
        events = new ArrayList<GameEvent>();
    }

    public void add(int index, GameEvent event) {
        events.add(event);
        eventIndices.add(index);
    }

    public int getEventIndex(int i) {
        return eventIndices.get(i);
    }

    public int getSize() {
        return events.size();
    }

    public Object getElementAt(int i) {
        return events.get(i);
    }
}
